<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业二</title>
    
</head>
<body>
    <form onsubmit="return getSubmit();">
        <p><label for="username">用户名：</label><input type="text" name="username" id="username"/></p>
        <p><label for="password">密&nbsp;&nbsp;&nbsp;码：</label><input type="password" name="password" id="password"/></p>
        <p><label>性&nbsp;&nbsp;&nbsp;别：</label><input type="radio" name="gender" value="1" checked="checked"> 男 &nbsp;&nbsp;<input type="radio" name="gender" value="0"/>女</p>
        <p>
            <label for="education">学&nbsp;&nbsp;&nbsp;历：</label>
            <select name="education" id="education">
                <option value="1">本科</option>
                <option value="0">专科</option>
            </select>
        </p>
        <p>
            <label for="selfIntroduce">自我介绍：</label>
        </p>
        <textarea cols="50" rows="5" name="selfIntroduce" id="selfIntroduce"/></textarea>
        <p><input type="submit" style="margin-left: 320px;"/></p>
    </form>

    <script>
        function getSubmit(){
            var username = document.getElementById("username");
            if("admin" != username.value){
                alert("用户名输入错误！");
            }
            else{
                var selfIntroduce = document.getElementById("selfIntroduce");
                alert(selfIntroduce.value);
            }
            return false;
        }
    </script>
</body>
</html>